home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gr2ps / pspicture.tex < prev    next >
Encoding:
Text File  |  1989-05-16  |  1.6 KB  |  59 lines

  1. %
  2. %  (c) 1986 John Coker
  3. %  University of California, Berkeley
  4. %
  5. %  pspicture.tex - example TeX document with a PostScript illustration
  6. %
  7. \magnification=\magstep1
  8. \baselineskip=14pt plus1pt
  9. \parskip=5pt plus2pt
  10. \nopagenumbers
  11.  
  12. \def\pspicture#1#2{\indent\vskip#2\special{#1}}
  13. \def\pscaption#1{\hbox to \hsize{\hss{#1}\hss}}
  14.  
  15. \def\\{\char92 }
  16. \def\{{\char123 }
  17. \def\}{\char125 }
  18.  
  19. \font\sc=amr8
  20. \def\PostScript{P{\sc OST}S{\sc CRIPT}}
  21.  
  22. This is a demonstration of a {\PostScript} picture inside \TeX.  We've
  23. done all this neatly with a simple {\TeX} macro that imbeds a
  24. {\tt \\special} command containing the name of a {\PostScript}
  25. file that is to be used as the picture itself.  Of course, this
  26. depends on the printer {\tt dvi} driver knowing that arguments to
  27. {\tt \\special}s are names of {\PostScript} files.
  28.  
  29. And now, of course, it's time for an example.
  30. The picture of the tank below was set into this text with the 
  31. simple set of commands:
  32.  
  33. \settabs8\columns
  34. \begingroup\baselineskip=12pt
  35. \+&\tt\\midinsert\cr
  36. \+&\tt\\pspicture\{tank.ps\}\{2in\}\cr
  37. \+&\tt\\pscaption\{\\bf A PostScript Picture\}\cr
  38. \+&\tt\\endinsert\cr
  39. \endgroup
  40.  
  41. \noindent And here is the picture:
  42.  
  43. \midinsert
  44. \pspicture{/d/texp/john/src/postscript/gr2ps/tank.ps}{2in}
  45. \pscaption{\bf A PostScript Picture}
  46. \endinsert
  47.  
  48. \noindent And here is text immediately following the picture.  Note
  49. that these macros depend on the user correctly specifying the picture
  50. height.  Unfortunately there is no way for {\TeX} and {\PostScript} to
  51. interact on a level where {\TeX} could automatically know the height
  52. of a {\PostScript} picture.
  53.  
  54. \medskip
  55. \+&&&&John Coker\cr
  56. \+&&&&August 1, 1986\cr
  57.  
  58. \bye
  59.